<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head >
    <meta charset="UTF-8">
    <title>码交流首页</title>
    <link rel="stylesheet" th:href="@{css/bootstrap.min.css}">
    <link rel="stylesheet" th:href="@{css/bootstrap-theme.min.css}">
    <link rel="stylesheet" th:href="@{css/index.css}">
    <script th:src="@{/js/jquery-3.3.1.js}"></script>
    <script th:src="@{js/bootstrap.min.js}"></script>
</head>
<script type="application/javascript">
    window.onload = function () {
        debugger;
        var closeAble = localStorage.getItem("closeAble");
        if (closeAble == "true"){
            window.close();
            //window.localStorage.removeItem("closeAble");
        }
    }
</script>
<body>
<div th:insert="~{navigation :: header}"></div>
<div class="container-fluid main">
    <div class="row">
        <div class="col-lg-9 col-md-12 col-sm-12 col-xs-12" style="">

            <h2><span class="glyphicon glyphicon-list" aria-hidden="true"></span>发现</h2>
            <hr>
            <div class="media" th:each="pageDto :${questionList.data}">
                <div class="media-left">
                    <a href="#">
                        <img class="img-circle"
                             th:src="${pageDto.user.avatarUrl}">
                    </a>
                </div>
                <div class="media-body">
                    <h4 class="media-heading description" th:text="${pageDto.title}"></h4>
                    <a th:href="@{'/question/'+ ${pageDto.id}}"><span>点击进入</span></a><span th:text="${pageDto.description}"></span><br>
                    <span class="text" th:text="${pageDto.commentCount}"></span>个回复 |
                    <span class="text" th:text="${pageDto.viewCount}"></span> 次浏览  |
                    <span class="text" th:text="${pageDto.likeCount}"></span> 次喜欢  |
                    <span class="text" th:text="${#dates.format(pageDto.gmtCreate,'yyyy年MM月dd日')}"></span>
                </div>
            </div>
            <nav aria-label="Page navigation">
                <ul class="pagination">
                    <li th:if="${questionList.showFirstPage}">
                        <a th:href="@{/(currentPage=1,search = ${search},tag = ${tag})}" aria-label="Previous">
                            <span aria-hidden="true">首页</span>
                        </a>
                    </li>
                    <li th:if="${questionList.showPreviousPage}">
                        <a th:href="@{/(currentPage=${questionList.currentPage - 1},search = ${search},tag = ${tag})}" aria-label="Previous">
                            <span aria-hidden="true">上一页</span>
                        </a>
                    </li>
                    <li th:each="page :${questionList.pages}" th:class="${questionList.currentPage == page} ? 'active': ''">
                        <a th:href="@{/(currentPage=${page},search = ${search},tag = ${tag})}"
                            th:text="${page}">

                    </a></li>
                    <li th:if="${questionList.showNextPage}">
                        <a th:href="@{/(currentPage=${questionList.currentPage + 1},search = ${search},tag = ${tag})}" aria-label="Next">
                            <span aria-hidden="true">下一页</span>
                        </a>
                    </li>
                    <li th:if="${questionList.showLastPage}">
                        <a th:href="@{/(currentPage=${questionList.pageTotalCount},search = ${search},tag = ${tag})}" aria-label="Next">
                            <span aria-hidden="true">尾页</span>
                        </a>
                    </li>
                </ul>
            </nav>
            <span>总记录数&nbsp;</span><span style="color: #074a54" th:text="${questionList.dataTotalCount}"></span>
            <apan>总页码&nbsp;</apan><span style="color: #074a54" th:text="${questionList.pageTotalCount}"></span>
        </div>
        <div class="col-lg-3 col-md-12 col-sm-12 col-xs-12">
            <h3> <span class="glyphicon glyphicon-fire" aria-hidden="true"></span>热门话题排行榜</h3>
            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                <hr class="col-lg-12 col-md-12 col-sm-12 col-xs-12 hr_top">
                <ul class="question-rated">
                    <li    th:each="hotTag : ${hotTagsCacheResponseDtos}">
                        <a th:href="@{/(currentPage=1,search = ${search},tag = ${hotTag.tag})}" th:text="${hotTag.tag}"></a><br>
                        <span class="text" th:text="${hotTag.commentCount}"></span>个回复 |
                        <span class="text" th:text="${hotTag.viewCount}"></span> 次浏览  |
                        <span class="text" th:text="${hotTag.likeCount}"></span> 次喜欢
                    </li>
                </ul>
            </div>

            <div th:insert="~{side :: side}"></div>


        </div>
    </div>
</div>
<div th:insert="~{footer :: foot}"></div>
</body>
</html>